package com.wiloon.java8x;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by wiloon on 8/10/14;
 */
public class FirstLambdaExpression {
    private static Logger logger = LoggerFactory.getLogger(FirstLambdaExpression.class);
    public String variable = "Class Level Variable";

    public static void main(String[] arg) {
        new FirstLambdaExpression().lambdaExpression();
        logger.info("done.");
    }

    public void lambdaExpression() {
        String variable = "Method Local Variable";
        String nonFinalVariable = "This is non final variable";
        new Thread(() -> {
            //Below line gives compilation error
            //String variable = "Run Method Variable"
            System.out.println("->" + variable);
            System.out.println("->" + this.variable);
        }).start();
    }
}